<?php
	/**
	 *	KLF Framework
	 *
	 *	Written by Kristian Oye <kristianoye@gmail.com> on Oct 22, 2011
	 *	Copyright (C) 2010-2011
	 */
	namespace KLF\System
	{
		use KLF\KCore;

		use KLF\System\Config\KApplicationConfiguration;
		
		/**
		 *  Class KApplication
		 *
		 *  The base for all application classes.
		 *
		 *  @package KLF\System
		 *  @access public
		 *  @author Kristian Oye <kristianoye@gmail.com>
		 *  @since 0.1
		 *  
		 *  @property-read KApplicationConfiguration $Config The application's configuration
		 */
		abstract class KApplication extends KComponent
		{
			/**
			 * The active application configuration.
			 * @var KApplicationConfiguration $_rpropConfig
			 */
			protected $_rpropConfig;
			
			public function __construct(KApplicationConfiguration $config)
			{
				$this->_rpropConfig = $config;
				parent::__construct();
			}
			
			/**
			 * Bogus Initialize() function
			 * 
			 * [[InheritedAttribute()]]
			 */
			abstract protected function Initialize();
			
			/**
			 * Runs the application
			 */
			public function Run()
			{
				KCore::SetApplication($this);
			}
		}
	}